<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			//构造函数
			function Ren(name,age,sex,amour,talk){
				this.name=name;
				this.age=age;
				this.sex=sex;
				this.amour=amour;
				this.ralk=talk;	
				
				this.sku=function(){
					document.write(name+"同学,"+age+",今年"+sex+"岁,有一个"+amour+",他"+amour+"对别人说："+talk)
				}
			}
			var ning=new Ren("小明","男",18,"男朋友","我和小明只是基友.")
			ning.sku()
			
			
			
			
			
			//工厂函数
			function car(name,papers,cost,instruction){
				var obj=new Object();
				obj.name=name;
				obj.papers=papers;
				obj.cost=cost;
				obj.instruction=instruction;
				obj.arc=function(){
					//document.write(this.name)
					alert("品牌："+this.name+";合格证："+this.papers+";建议零售价："+cost+";说明书："+instruction+";")
				}
				
				return obj
			}
			
			var yield=car("黑蝙蝠","conn 0000112","2200000$","横冲直撞，无所阻挡")
			yield.arc()
			
			
			
		</script>
	</body>
</html>
